package com.mcx.modules.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author mcx
* @date 2022-04-29
**/
@Entity
@Data
@Table(name="log_killmonster")
public class LogKillmonster implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "编号")
    private Integer id;

    @Column(name = "status",nullable = false)
    @NotNull
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "player_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "玩家Id")
    private Integer playerId;

    @Column(name = "play_type",nullable = false)
    @NotNull
    @ApiModelProperty(value = "0=游戏关卡1=世界地图野外场景")
    private Integer playType;

    @Column(name = "play_scene_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "0：游戏关卡Id1：世界地图Id这个类型对应的场景Id，比如类型是游戏关卡 则对应游戏关卡Id")
    private Integer playSceneId;

    @Column(name = "grade",nullable = false)
    @NotNull
    @ApiModelProperty(value = "难度等级")
    private Integer grade;

    @Column(name = "monster_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "怪物Id")
    private Integer monsterId;

    @Column(name = "monster_count",nullable = false)
    @NotNull
    @ApiModelProperty(value = "怪物数量")
    private Integer monsterCount;

    @Column(name = "create_time",nullable = false)
    @NotNull
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    public void copy(LogKillmonster source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}